import Vue from 'vue'
import VueRouter from 'vue-router'
import MainPage from '@/view/mainPage/MainPage'
import QuestionTypes from '@/view/mainPage/left/QuestionTypes'
import Questionnaire from '@/view/mainPage/right/Questionnaire'
import Page1 from '@/view/mainPage/left/Page1'
import Page2 from '@/view/mainPage/left/Page2'
import Page3 from '@/view/mainPage/left/Page3'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/MainPage'
  },
  {
    path: '/MainPage',
    component: MainPage,
    redirect: '/MainPage/Question',
    children: [
      {
        path: 'Question',
        redirect: '/MainPage/Question/Page1',
        components: {
          QuestionTypes: QuestionTypes,
          Questionnaire: Questionnaire
        },
        children: [
          {
            path: 'Page1',
            component: Page1
          },
          {
            path: 'Page2',
            component: Page2
          },
          {
            path: 'Page3',
            component: Page3
          }
        ]
      }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
